module Enumerable
  def group_by
    group = {}
    self.each do |item|
      result = yield(item)
	  if group.has_key?(result)
	    group[result] << item
	  else
	    group[result] = [item]
	  end
    end
	return group
  end
  def each_even
    self.select { |x| x % 2 == 0 }.each do |item|
		yield(item)
	end
  end
  def each_grouped_by_first_letter
    group = self.group_by { |x| x[0,1].to_s }
    group.to_a.each do |item|
		yield(item)
	end
  end
end